#ifndef _SEMAPHORE_H_
#define _SEMAPHORE_H_
#include<mutex>
#include<atomic>
#include<condition_variable>
class Semaphore
{
  public:
  Semaphore(int initSize =0);
  Semaphore(const Semaphore&)=delete;
  Semaphore &operator=(const Semaphore&)=delete;
  ~Semaphore();
   void Post();
   void Wait();
  private:
    int initSize_;
    std::mutex mutex_;
    std::condition_variable condition_variable_;
   std::atomic_bool isExit_;
};
#endif